if __name__ == '__main__':
    A = {'高等数学', '英语', '数据结构', 'Python编程'}
    B = {'C语言程序设计', 'Java程序设计', '英语', '编译原理', '数据结构'}

    # 计算集合交集
    inter1 = A & B
    print(inter1)

    inter2 = A.intersection(B)
    print(inter2)

    # 计算集合并集
    union1 = A | B
    print(union1)
    union2 = A.union(B)
    print(union2)

    # 计算集合差集
    diff1 = A - B
    print(diff1)
    diff2 = A.difference(B)
    print(diff2)

    # 计算对称差集.并集-差集
    sym1 = A ^ B
    print(sym1)
    sym2 = A.symmetric_difference(B)
    print(sym2)
